<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>

<head>
</head>
<style>
.mui-ellipsis {
	width: 65%;
}
</style>

<body>
	<div id="leg_table"></div>
	<script type="text/html" id="Bar">
			<a class="mui-btn mui-btn-primary more">详情</a>
			<a class="mui-btn mui-btn-primary already">已解决</a>
		</script>
	<script type="text/javascript">
        	mui('#offCanvasContentScroll').scroll().scrollTo(0,0);
        
        	$(".mui-title").html("错误日志");
        	
        	//接收数据
    		var stateList = $.legTable({
    			limit: 10,			//默认10
    			page:1,				//默认1
    			id:"#leg_table",	//绑定id
    			url:"/errLog/getErrorList",
    			cols:[
    				{field: 'ip', title: 'IP'},
    	            {field: 'userName', title: '用户'},
    	            {field: 'className', title: '类名'},
    	            {field: 'methodName', title: '方法名'},
    	            {field: 'errorType', title: '错误类型'},
    	            {field: 'creatTime', title: '时间'},
    	            {title: '操作',templet:'#Bar'}
    	        ]
    		});
			
			//错误详情
			$("#leg_table").on("touchstart", ".table-list .more", function(e){
				let i = $(this).parent('data').attr("value");
				let url = "/errLog/errDeil?errorId="+$.data(i).errorId;
				window.location.hash = url;
				sessionStorage.setItem("url",url)
		    })
           	
           //删除
           $("#leg_table").on("touchstart", ".table-list .already", function(e){
        	    let i = $(this).parent('data').attr("value");
       	    	mui.confirm('确定已解决？','温馨提示',function(e) {
					if (e.index == 1) {
						$.get("/errLog/deleteMsg?errorId="+$.data(i).errorId,function(res){
			           		if (!res.success) {
			           			mui.toast(res.message);
			       			}else{
			       				mui.toast("设置成功");
			       				stateList = $.legTable();
			       			}
			           	})
					}
				})
            })
			
		</script>
</body>

</html>